package com.iotechn.unimall.admin.api.coupon;

import com.dobbinsoft.fw.core.annotation.HttpMethod;
import com.dobbinsoft.fw.core.annotation.HttpOpenApi;
import com.dobbinsoft.fw.core.annotation.HttpParam;
import com.dobbinsoft.fw.core.annotation.HttpParamType;
import com.dobbinsoft.fw.core.annotation.param.NotNull;
import com.dobbinsoft.fw.core.exception.ServiceException;
import com.dobbinsoft.fw.support.model.Page;
import com.iotechn.unimall.data.domain.XHCouponDO;
import com.iotechn.unimall.data.vo.XHCouponVO;

import java.math.BigDecimal;
import java.util.List;

@HttpOpenApi(group = "admin.XHCoupon", description = "协会优惠卷")
public interface AdminXHCouponService {

    @HttpMethod(description = "查询Page", permission = "admin:XHCoupon:page", permissionParentName = "优惠券列表", permissionName = "优惠券管理")
    public Page<XHCouponVO> page(
            @HttpParam(name = "amountStart", type = HttpParamType.COMMON, description = "金额开始范围") BigDecimal amountStart,
            @HttpParam(name = "amountEnd", type = HttpParamType.COMMON, description = "金额结束范围") BigDecimal amountEnd,
            @HttpParam(name = "issuerId", type = HttpParamType.COMMON, description = "发放人id") Long issuerId,
            @HttpParam(name = "holder", type = HttpParamType.COMMON, description = "持有人id") String holder,
            @HttpParam(name = "status", type = HttpParamType.COMMON, description = "优惠卷发放状态") Integer status,
            @HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "10") Integer limit,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "修改", permission = "admin:XHCoupon:update", permissionParentName = "优惠券列表", permissionName = "优惠券管理")
    public String update(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "优惠券id")Long id,
            @NotNull @HttpParam(name = "discount", type = HttpParamType.COMMON, description = "金额") BigDecimal discount,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "删除", permission = "admin:XHCoupon:delete", permissionParentName = "优惠券列表", permissionName = "优惠券管理")
    public String delete(
            @HttpParam(name = "id", type = HttpParamType.COMMON, description = "优惠券id") Long id,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "批量删除", permission = "admin:XHCoupon:batchDelete", permissionParentName = "优惠券列表", permissionName = "优惠券管理")
    public String batchDelete(
            @HttpParam(name = "ids", type = HttpParamType.COMMON, description = "优惠券id") String ids,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;


    @HttpMethod(description = "发放", permission = "admin:XHCoupon:grant", permissionParentName = "优惠券列表", permissionName = "优惠券管理")
    public String grant(
            @NotNull @HttpParam(name = "amount", type = HttpParamType.COMMON, description = "优惠券金额") BigDecimal amount,
            @NotNull @HttpParam(name = "clientIds", type = HttpParamType.COMMON, description = "客户id") String clientIds,
            @NotNull @HttpParam(name = "startTime", type = HttpParamType.COMMON, description = "优惠券开始时间") String startTime,
            @NotNull @HttpParam(name = "endTime", type = HttpParamType.COMMON, description = "优惠券结束时间") String endTime,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;


    @HttpMethod(description = "核销", permission = "admin:XHCoupon:cancelAfterVerification", permissionParentName = "优惠券列表", permissionName = "优惠券管理")
    public String cancelAfterVerification(
            @HttpParam(name = "uuid", type = HttpParamType.COMMON, description = "优惠券id") String uuid,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

}
